import request from '@/utils/request'

export function GetUserAddressList() { // 获取单个客户的地址列表
  return request({
    url: '/useraddress/get_user_address_list',
    method: 'get'
  })
}

export function PutEditUserAddress(params) { // 修改一个客户地址
  return request({
    url: '/useraddress/edit_user_address/' + params.user_address_id,
    method: 'put',
    params
  })
}

export function putDelUserAddress(params) { // 删除一个客户地址
  return request({
    url: '/useraddress/del_user_address/' + params.user_address_id,
    method: 'put'
  })
}

export function PostAddUserAddress(params) { // 新增一个客户地址
  return request({
    url: '/useraddress/add_user_address',
    method: 'post',
    params
  })
}

export function putSetUserAddressDefault(params) { // 设置一个客户地址为默认
  return request({
    url: '/useraddress/set_user_address_default/' + params.user_address_id,
    method: 'put'
  })
}

// 编辑头像
export function editAvatar(data) {
  return request({
    url: '/user/edit_head_image',
    method: 'put',
    data
  })
}

// 编辑头像
export function getOrderCount(data) {
  return request({
    url: '/user/get_order_count',
    method: 'get',
    data
  })
}
